#pragma once
#include "ICusServ.h"
#include "MsgSpliter.h"

class CusServ : public ICusServ
{
public:
	CusServ(SOCKET sock) : m_sock(sock) {}
	
	bool UserReg(char szAccount[], char szPasswd[]);
	bool UserAuth(char szAccount[], char szPasswd[]);
	void UserSelRoute(IN MSG_ROUTE_SEL& sel, OUT vector<ROUT_ENTRY>*& pVecRes);
	bool UserReserve(int nRouteId, CABIN_TYPE nCabTp);
	void ViewOrders(vector<ORDER_ENTRY>*& pVecRes);
	bool CancelOrder(int nOrderId);

	void DestroyRoutes(vector<ROUT_ENTRY>* pVecRes) { delete pVecRes; }
	void DestroyOrders(vector<ORDER_ENTRY>* pVecRes) { delete pVecRes; }

private:
	SOCKET m_sock;
	CMsgSpliter m_splitter;
};

